package Ptolemaiosz;

public class Controller {
	private Application application;
        
        public void setApplication(Application a)
            {
                application = a;
            }

	public void handleKeyPressed(char c)
            {
                if (c == 'w')
                            {
                                //Majd o ellenorzi mozaik nezetben van-e
                                application.moveLevelPart(Direction.down);

                                //Majd o ellenorzi jatekos nezetben van-e
                                application.moveAvatar(Direction.up, 1);
                            }

                 if(c == 'a')
                            {
                                //Majd o ellenorzi mozaik nezetben van-e
                                application.moveLevelPart(Direction.right);

                                //Majd o ellenorzi jatekos nezetben van-e
                                application.moveAvatar(Direction.left, 1);
                            }

                 if(c == 'd')
                            {
                                //Majd o ellenorzi mozaik nezetben van-e
                                application.moveLevelPart(Direction.left);

                                //Majd o ellenorzi jatekos nezetben van-e
                                application.moveAvatar(Direction.right, 1);
                            }

                    if (c == 's')
                            {
                                //Majd o ellenorzi mozaik nezetben van-e
                                application.moveLevelPart(Direction.up);
                            }

                    if (c == 'i')
                            {
                                //Majd o ellenorzi mozaik nezetben van-e
                                application.moveLevelPart(Direction.up);

                                //Majd o ellenorzi jatekos nezetben van-e
                                application.moveAvatar(Direction.up, 2);
                            }

                    if (c == 'j')
                            {
                                //Majd o ellenorzi mozaik nezetben van-e
                                application.moveLevelPart(Direction.left);

                                //Majd o ellenorzi jatekos nezetben van-e
                                application.moveAvatar(Direction.left, 2);
                            }

                    if (c == 'l')
                            {
                                //Majd o ellenorzi mozaik nezetben van-e
                                application.moveLevelPart(Direction.right);

                                //Majd o ellenorzi jatekos nezetben van-e
                                application.moveAvatar(Direction.right, 2);
                            }


                    if (c == 'r')
                            {
                                application.restartLevel();
                            }

                if (c == 'n')
                            {
                                application.nextLevel();
                            }

                if (c == ' ')
                            {
                                application.chageViewMode();
                            }

                    
            }
        

                
}